-- GENERATED SPELL FOR [Earthmender Wilda] --


function spell0_21027(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(16006,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21027', 3000, 1)
end

function spell1_21027(pUnit, Event) --@Earthbind Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(15786,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_21027', 1, 1)
end

function spell2_21027(pUnit, Event) --@Frost Shock,n/a--
pUnit:FullCastSpellOnTarget(12548,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21027', 8300, 1)
end

function spell3_21027(pUnit, Event) --@Healing Wave,Heal--
pUnit:FullCastSpellOnTarget(12491,pUnit)
pUnit:RegisterEvent('Sorts_21027', 3000, 1)
end

function Sorts_21027(pUnit, Event)
local choix_sorts_21027 = math.random(0, 3)
if choix_sorts_21027 == 0 then
pUnit:RegisterEvent('spell0_21027', 1, 1)
end
if choix_sorts_21027 == 1 then
pUnit:RegisterEvent('spell1_21027', 1, 1)
end
if choix_sorts_21027 == 2 then
pUnit:RegisterEvent('spell2_21027', 1, 1)
end
if choix_sorts_21027 == 3 then
pUnit:RegisterEvent('spell3_21027', 1, 1)
end
end

function mob21027_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21027', math.random(1500, 3000), 1)
end

function mob21027_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21027_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21027_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21027, 1, 'mob21027_Action')
RegisterUnitEvent(21027, 2, 'mob21027_Leave')
RegisterUnitEvent(21027, 3, 'mob21027_Kill')
RegisterUnitEvent(21027, 4, 'mob21027_Die')
